package com.elong.qadev.entity;

import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name = "HTTP_HTTPCASE", schema = "ti")
public class HttpCase {

	public HttpCase(int id, int caseId, String caseType, String httpUrl,
			String httpMethod, String ower, Date createDateTime,
			Date modifyDateTime, String remarks) {
		super();
		this.id = id;
		this.caseId = caseId;
		this.caseType = caseType;
		this.httpUrl = httpUrl;
		this.httpMethod = httpMethod;
		this.ower = ower;
		this.createDateTime = createDateTime;
		this.modifyDateTime = modifyDateTime;
		this.remarks = remarks;
	}

	private int id;
	private int caseId;
	private String caseType;
	private String httpUrl;
	private String httpMethod;
	private String response;
	private boolean isExpected;
	private String ower;
	private Date createDateTime;
	private Date modifyDateTime;
	private String remarks;

	public HttpCase() {
		super();
		// TODO Auto-generated constructor stub
	}

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "ID", unique = true, nullable = false, length = 10)
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	@Column(name = "CASEID", nullable = false, length = 50)
	public int getCaseId() {
		return caseId;
	}

	public void setCaseId(int caseId) {
		this.caseId = caseId;
	}

	@Column(name = "CASETYPE", nullable = true, length = 50)
	public String getCaseType() {
		return caseType;
	}

	public void setCaseType(String caseType) {
		this.caseType = caseType;
	}

	@Column(name = "HTTPURL", nullable = false, length = 150)
	public String getHttpUrl() {
		return httpUrl;
	}

	public void setHttpUrl(String httpUrl) {
		this.httpUrl = httpUrl;
	}

	@Column(name = "HTTPMETHOD", nullable = true, length = 20)
	public String getHttpMethod() {
		return httpMethod;
	}

	public void setHttpMethod(String httpMethod) {
		this.httpMethod = httpMethod;
	}

	@Column(name = "OWER", nullable = true, length = 50)
	public String getOwer() {
		return ower;
	}

	public void setOwer(String ower) {
		this.ower = ower;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "CREATEDATE", length = 7)
	public Date getCreateDateTime() {
		return createDateTime;
	}

	public void setCreateDateTime(Date createDateTime) {
		this.createDateTime = createDateTime;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "MODIFYDATE", length = 7)
	public Date getModifyDateTime() {
		return modifyDateTime;
	}

	public void setModifyDateTime(Date modifyDateTime) {
		this.modifyDateTime = modifyDateTime;
	}

	@Column(name = "REMARKS", nullable = true, length = 150)
	public String getRemarks() {
		return remarks;
	}

	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}

	@Lob
	@Basic(fetch = FetchType.LAZY)
	@Column(name = "RESPONSE", nullable = true)
	public String getResponse() {
		return response;
	}

	public void setResponse(String response) {
		this.response = response;
	}

	@Column(name = "ISEXPECTED", nullable = false)
	@org.hibernate.annotations.Type(type = "yes_no")
	public boolean isExpected() {
		return isExpected;
	}

	public void setExpected(boolean isExpected) {
		this.isExpected = isExpected;
	}

	@Override
	public String toString() {
		return "HttpCase [id=" + id + ", caseId=" + caseId + ", caseType="
				+ caseType + ", httpUrl=" + httpUrl + ", httpMethod="
				+ httpMethod + ", response=" + response + ", isExpected="
				+ isExpected + ", ower=" + ower + ", createDateTime="
				+ createDateTime + ", modifyDateTime=" + modifyDateTime
				+ ", remarks=" + remarks + "]";
	}

}
